﻿using System;
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Records;

namespace EDB.SmoothStreaming.Models {
    public class VideoPartRecord : ContentPartRecord {
        public virtual Guid VideoId { get; set; }
        public virtual int ThumbnailWidth { get; set; }
        public virtual int ThumbnailHeight { get; set; }
        public virtual int ThumbnailCount { get; set; }
        public virtual string VideoStreams { get; set; }
        public virtual int PlayerWidth { get; set; }
        public virtual int PlayerHeight { get; set; }
        public virtual long Duration { get; set; }
        public virtual int ThumbnailFormat { get; set; } 
    }

    public class VideoPart : ContentPart<VideoPartRecord> {
        public Guid VideoId {
            get { return Record.VideoId; }
            set { Record.VideoId = value; }
        }
        public int ThumbnailWidth {
            get { return Record.ThumbnailWidth; }
            set { Record.ThumbnailWidth = value; }
        }
        public int ThumbnailHeight {
            get { return Record.ThumbnailHeight; }
            set { Record.ThumbnailHeight = value; }
        }
        public int ThumbnailCount {
            get { return Record.ThumbnailCount; }
            set { Record.ThumbnailCount = value; }
        }
        public string VideoStreams {
            get { return Record.VideoStreams; }
            set { Record.VideoStreams = value; }
        }
        public int PlayerWidth {
            get { return Record.PlayerWidth; }
            set { Record.PlayerWidth = value; }
        }
        public int PlayerHeight {
            get { return Record.PlayerHeight; }
            set { Record.PlayerHeight = value; }
        }
        public long Duration {
            get { return Record.Duration; }
            set { Record.Duration = value; }
        }
        public ThumbnailFormat ThumbnailFormat {
            get { return (ThumbnailFormat)Record.ThumbnailFormat; }
            set { Record.ThumbnailFormat = (int)value; }
        }
    }

    public enum ThumbnailFormat {
        Jpg,
        Png,
        Gif
    }
}